<div class="view">
    <h5><?php echo CHtml::encode($data->report->name); ?></h5>

    <table>

        <tr>
            <td>
                <b><?php echo CHtml::encode(Reports::model()->getAttributeLabel('description')); ?>:</b>
                   <?php echo CHtml::encode($data->report->description); ?>
            </td>
            <td width="100px">
                        <?php

$user_id = Yii::app()->getModule('user')->user()->profile->org_id;
$rec_id = $data->rec_id;

$this->widget('zii.widgets.jui.CJuiButton',
	array(
		'name'=>'button'.$data->report_id.$rec_id,
                'caption'=>'MAIL ME!',
                'value'=>'asd',
		'onclick'=>'js:function(){
                        jQuery.ajax({
                            "type":"POST",
                            "url":"'.Yii::app()->createUrl('//reports/mailmyuserreports', array('id' => $data->report_id,'rec_id'=>$rec_id,'org_id'=>$user_id)).'",
                            "success":$(\'#Notification\').jnotifyAddMessage({
                                    text: \'Report send to recipient...\',
                                    permanent: false,
                                    showIcon: true
                            }),
                        });
                }',
        )
);

?>

            </td>
        </tr>

        <tr>
            <td colspan="2">

                <?php 
                
                $criteria=new CDbCriteria(array(
                    'condition'=>'rec_id = '.$rec_id, //action 1 is NoteAddCustumer
                ));            

                $detailData = new CActiveDataProvider('QVfilters',array(                
                    'criteria'=>$criteria,
                    'pagination'=>array(
                        'pageSize'=>15,
                    ),
                ));
                                
                $this->renderPartial('//qvfilters/_subview_myreports', array('qvfmodel'=>$detailData)); ?>

            </td>
        </tr>

    </table>

</div>